using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblNgoaiNguUI
{ 
	private int idNgoaiNgu;
	public int IdNgoaiNgu
	{
		get { return idNgoaiNgu;}
		set { idNgoaiNgu = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private String tenNgoaiNgu;
	public String TenNgoaiNgu
	{
		get { return tenNgoaiNgu;}
		set { tenNgoaiNgu = value;}
	}

	private String ngheNoi;
	public String NgheNoi
	{
		get { return ngheNoi;}
		set { ngheNoi = value;}
	}

	private String doc;
	public String Doc
	{
		get { return doc;}
		set { doc = value;}
	}

	private String viet;
	public String Viet
	{
		get { return viet;}
		set { viet = value;}
	}

	public tblNgoaiNguUI() {}

	public tblNgoaiNguUI(int idNgoaiNgu, int idChuyenGia, String tenNgoaiNgu, String ngheNoi, String doc, String viet)
	 {
		this.idNgoaiNgu = idNgoaiNgu;
 		this.idChuyenGia = idChuyenGia;
 		this.tenNgoaiNgu = tenNgoaiNgu;
 		this.ngheNoi = ngheNoi;
 		this.doc = doc;
 		this.viet = viet;
 	}

	public int Add(int idChuyenGia, String tenNgoaiNgu, String ngheNoi, String doc, String viet)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblNgoaiNgu_Add",idChuyenGia,tenNgoaiNgu,ngheNoi,doc,viet);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idNgoaiNgu, int idChuyenGia, String tenNgoaiNgu, String ngheNoi, String doc, String viet)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblNgoaiNgu_Update",idNgoaiNgu,idChuyenGia,tenNgoaiNgu,ngheNoi,doc,viet);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idNgoaiNgu)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblNgoaiNgu_Delete",idNgoaiNgu);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblNgoaiNgu_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idNgoaiNgu)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblNgoaiNgu_Get",idNgoaiNgu);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblNgoaiNgu_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblNgoaiNgu_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
